define(function(require){
	var $ = require("jquery");
	var justep = require("$UI/system/lib/justep");
	var help = require("$UI/highde/modbusItems/lib/settingEditDialogHelp");
	
	var Model = function(){
		this.callParent();
	};

	Model.prototype.saveCommit = function(event){
		debugger;
		if(this.operation == "new"){
			this.comp("userProjectData").newData({
			defaultValues :[{
				"fID":justep.UUID.createUUID(),
				"fUserName":localStorage.getItem("username"),
				"fProjectID":this.projectId}]
			});
			this.comp("userProjectData").saveData();
		}
		justep.Util.hint("保存数据成功！");
		this.close();
	};

	Model.prototype.windowReceiver1Receive = function(event){	
		help.getData(this.comp("mainData"), event.data.id, event.data.operation);
		this.comp("mainData").setValue("fProjectAdmin", localStorage.getItem("username"));
		this.projectId = this.comp("mainData").getValue("fID");
		this.operation = event.data.operation;
	};

	return Model;
});